﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Moq;
using MutationTestingTool.Model.Interfaces;
using MutationTestingTool.Model.Model;

namespace MutationTestingTool.Tests.Core
{
    [TestFixture]
    [Category("Core")]
    public class MutationTest
    {
        IMutationRepository repository;
        [SetUp]
        public void InitTest()
        {
            Mock<IMutationRepository> mock = new Mock<IMutationRepository>();
            mock.Setup(m => m.Mutations).Returns(new Mutation[] 
            {
                new Mutation() { OriginalValue = "==", ReplaceValue = "!="},
                new Mutation() { OriginalValue = "==", ReplaceValue = "<="},
                new Mutation() { OriginalValue = "==", ReplaceValue = ">="},
                new Mutation() { OriginalValue = "==", ReplaceValue = "<"},
                new Mutation() { OriginalValue = "==", ReplaceValue = ">"},
                new Mutation() { OriginalValue = "++", ReplaceValue = "--"},
                new Mutation() { OriginalValue = "--", ReplaceValue = "++"},
                new Mutation() { OriginalValue = " + ", ReplaceValue = " - "},
                new Mutation() { OriginalValue = " - ", ReplaceValue = " + "}
            }.AsQueryable());

            repository = mock.Object;
        }

        [Test]
        public void IsMockInitialize()
        {
            Assert.IsNotNull(repository);
            Assert.AreEqual(9, repository.Mutations.Count());
        }
    }
}
